package com.basic;

import java.util.StringTokenizer;

import com.sun.media.sound.JDK13Services;

public class StringTokenizerTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// spring.context.config=/applicationContext-DAO.xml,/applicationContext-JNDI.xml
		String springConfig = "/applicationContext-DAO.xml,/applicationContext-JNDI.xml";
		//jdk1.0开始
		StringTokenizer st = new StringTokenizer(springConfig, ",");
		String paths[] = new String[st.countTokens()];
		int k = 0;
		while (st.hasMoreTokens()) {
			paths[k++] = st.nextToken();
		}

		for (int i = 0; i < paths.length; i++) {
			String path = paths[i];
			System.out.println(path);
		}
		//JDK1.4开始
		String[] paths2 = springConfig.split(",");
		for (int i = 0; i < paths2.length; i++) {
			String path = paths2[i];
			System.out.println(path);
		}
	}

}
